"use strict";

var path = require("path");
var gulp = require("gulp");
var source = path.join(__dirname, "..", "src", "app", "components", "**", "*.jsx");
var build = path.join(__dirname, "..", "doc", "components");

/**
 * Generate documentation for components.
 *
 * @method componentDoc
 */
function componentDoc() {
  var plugins = this.opts.plugins;
  gulp.src(source)
    .pipe(plugins.reactDoc({
      path: build
    }))
    .pipe(plugins.markdownDoc("index.html", {
      yamlMeta: false
    }))
    .pipe(gulp.dest(build));
}
module.exports = componentDoc;
